Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enable CORS with hot-reloaded origins #3601

Merged
merged 9 commits into from
Aug 16, 2023
Merged

fix: enable CORS with hot-reloaded origins #3601

merged 9 commits into from
Aug 16, 2023

Conversation

zepatrik
Copy link
Member

As far as I can tell CORS cannot work right now 😅
See ory/kratos#3423

@zepatrik zepatrik requested a review from aeneasr as a code owner August 10, 2023 08:02
cmd/server/handler.go Show resolved Hide resolved
internal/httpclient/go.sum Outdated Show resolved Hide resolved
aeneasr
aeneasr previously approved these changes Aug 10, 2023
@@ -78,11 +74,11 @@ func RunServeAdmin(slOpts []servicelocatorx.Option, dOpts []driver.OptionsModifi
ctx := cmd.Context()
sl := servicelocatorx.NewOptions(slOpts...)

d, err := driver.New(cmd.Context(), sl, append(dOpts, driver.WithOptions(configx.WithFlags(cmd.Flags()))))
d, err := driver.New(cmd.Context(), sl, append(dOpts, driver.WithOptions(append(cOpts, configx.WithFlags(cmd.Flags()))...)))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why those options were not passed on?

@@ -312,6 +308,9 @@ func serve(
) {
defer wg.Done()

cfg, _ := d.Config().CORS(ctx, iface)
handler = cors.New(cfg).Handler(handler)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always enabled now because the function hot-reloads "enabled" as well.

@codecov
Copy link

codecov bot commented Aug 11, 2023

Codecov Report

Merging #3601 (12ea6da) into master (c004fee) will decrease coverage by 0.01%.
Report is 1 commits behind head on master.
The diff coverage is 0.00%.

❗ Current head 12ea6da differs from pull request most recent head 6d8ddcf. Consider uploading reports for the commit 6d8ddcf to get more accurate results

@@            Coverage Diff             @@
##           master    #3601      +/-   ##
==========================================
- Coverage   76.28%   76.27%   -0.01%     
==========================================
  Files         132      132              
  Lines        9984     9987       +3     
==========================================
+ Hits         7616     7618       +2     
- Misses       1848     1849       +1     
  Partials      520      520              
Files Changed Coverage Δ
cmd/server/handler.go 1.32% <0.00%> (-0.02%) ⬇️

... and 1 file with indirect coverage changes

aeneasr
aeneasr previously approved these changes Aug 14, 2023
@zepatrik zepatrik requested a review from aeneasr August 16, 2023 09:37
@aeneasr aeneasr merged commit 6f592fc into master Aug 16, 2023
28 checks passed
@aeneasr aeneasr deleted the fix/cors branch August 16, 2023 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants